# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=cargo-make
pkgver=0.37.11
pkgrel=0
pkgdesc="Rust task runner and build tool"
url="https://github.com/sagiegurari/cargo-make"
# riscv64: TODO
# s390x: fails to build nix crate
arch="all !riscv64 !s390x"
license="Apache-2.0"
makedepends="cargo openssl-dev cargo-auditable"
subpackages="$pkgname-bash-completion"
source="https://github.com/sagiegurari/cargo-make/archive/$pkgver/cargo-make-$pkgver.tar.gz
	update-rust-libc.patch
	"
options="!check"  # FIXME: some tests are broken

_cargo_opts="--frozen --no-default-features --features tls-native"


prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build $_cargo_opts --release
}

check() {
	cargo test $_cargo_opts
}

package() {
	install -D -m755 -t "$pkgdir"/usr/bin/ \
		target/release/cargo-make \
		target/release/makers

	install -D -m644 extra/shell/makers-completion.bash \
		"$pkgdir"/usr/share/bash-completion/completions/makers
}

sha512sums="
9e74534863a305b5d0bac867d68a95d210a27cfea122050a5d2ee13508de12db64992a41a518557f8d768386b8011c1727b5f26f3b261509708e2a9803e87ae5  cargo-make-0.37.11.tar.gz
93293f75673506deb3d3b167f29ec3ebdfba4ab03935c7230aa71b47f89e12b57d21a8bff5a36293e6b6e37e7ad6fc3431c94fb088410b8739d52d6940dde45d  update-rust-libc.patch
"
